--- title: Signal To Noise Ratio for the OpenHSI Camera keywords: fastai sidebar: home_sidebar summary: "Includes an interactive SNR calculator." description: "Includes an interactive SNR calculator." nb_path: "nbs/04_snr.ipynb" ---
{% raw %}
{% endraw %}

{% include tip.html content='This module can be imported using from openhsi.snr import *' %} This module contains a 6SV1.1 Atmospheric Correction class that computes the pixel radiance given some parameters and a servable interactive SNR widget. 6SV is an open souce radiative transfer code that predicts the solar spectrum received by a sensor facing the Earth. Since it is written in Fortran, we use a Python wrapper called Py6S to expose the functionality and that means we are limited to using 6SV1.1 rather than the newer 6SV2.1.

Theory

The F number of an optical system is a measure of overall light throughput (the ability to produce contrast at a given resolution) and is given by
{% raw %} $$ F/\# = \frac{f}{ \varnothing _{\text{EA}}} $$ {% endraw %} where $f$ is the focal length and $\varnothing _{\text{EA}}$ is the effective aperture diameter.

Assuming the dominant source of noise is photon shot noise $\sigma_s=\sqrt{S}$, the SNR is given by {% raw %} $$ \text{SNR} \approx S/\sigma_s = \sqrt{S}$$ {% endraw %} where the signal $$S= \eta_{QE} N\Delta t$$ with $\eta_{QE,\lambda}$ the quantum efficiency, $N$ the photons per second and $\Delta t$ the exposure time.

The number of photons per second is given by the formula $$ N_\lambda = L_\lambda \rho_\lambda \eta_{opt} \eta_G \eta_{QE} A_d \Delta\lambda \frac{\lambda}{hc} \frac{\pi}{4(F/\#)^2} $$ where $L_\lambda$ is the solar radiance at Earth's surface given the geolocation and UTC time, $\rho_\lambda$ is the surface reflectance, $\eta_{opt}$ is the optical efficiency, $\eta_G$ is the grating efficiency, $\eta_{QE}$ is the quantum efficiency of the sensor, $A_d$ is the detector area, $\Delta \lambda$ is the FWHM or bandwidth, and $\lambda$ is wavelength.

{% raw %}
{% endraw %} {% raw %}
{% endraw %}
{% raw %}
%time ref_model = Model6SV(wavelength_array = np.linspace(390,820,num=100),sixs_path="../../Downloads/6SV1.1/sixsV1.1") 
ref_model.show()
100%|██████████| 100/100 [00:24<00:00,  4.07it/s]
CPU times: user 1.4 s, sys: 935 ms, total: 2.34 s
Wall time: 25.5 s
{% endraw %} {% raw %}

class Widget_SNR[source]

Widget_SNR(ref_model:Model6SV) :: Parameterized

params(DE_model=ObjectSelector, QE_model=ObjectSelector, aperture_mm=Number, bandwidth_nm=Number, focal_length_mm=Number, integration_time_ms=Number, optical_trans_efficiency=Number, pixel_length_x_μm=Number, pixel_length_y_μm=Number, surface_albedo=Number, name=String)
OpenHSI SNR calculator
Parameters of 'Widget_SNR'
==========================

Parameters changed from their default values are marked in red.
Soft bound values are marked in cyan.
C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name                           Value            Type         Bounds   Mode 

aperture_mm                      4             Number       (1, 200)  V RW 
focal_length_mm                  16            Number                 V RW 
pixel_length_x_μm                65            Number       (1, 80)   V RW 
pixel_length_y_μm               6.9            Number       (1, 60)   V RW 
integration_time_ms              10            Number       (5, 100)  V RW 
bandwidth_nm                     4             Number      (0.1, 20)  V RW 
QE_model                     'imx252qe'    ObjectSelector             V RW 
surface_albedo                  0.3            Number       (0, 1.0)  V RW 
optical_trans_efficiency        0.9            Number       (0.1, 1)  V RW 
DE_model                   '600lpmm_28.7'  ObjectSelector             V RW 

Parameter docstrings:
=====================

aperture_mm:              aperture (mm)
focal_length_mm:          focal length (mm)
pixel_length_x_μm:        pixel length x (μm)
pixel_length_y_μm:        pixel length y (μm)
integration_time_ms:      integration time (ms)
bandwidth_nm:             FWHM bandwidth (nm)
QE_model:                 Camera QE model
surface_albedo:           constant surface albedo reflectance
optical_trans_efficiency: Optical transmission efficiency
DE_model:                 Grating efficiency model
{% endraw %} {% raw %}
{% endraw %} {% raw %}
widget = Widget_SNR(ref_model=ref_model,name="Interactive SNR Widget")
pn.Row(widget.param,widget.view)
{% endraw %}